#include <random>
#include <chrono>
#include <typeinfo>

//#define FILE_IO //uncomment when "write in file"
#if defined( FILE_IO )
ofstream fcout ( "output.out" );
#define OUT fcout
#else
#define OUT cout
#endif
template<class T,class Integer>
        class MyRandom {
            private:
            T from;
            T to;
            Integer cnt;
            unsigned seed;
            public:
            MyRandom ( T from_, T to_, Integer cnt_ ) {
                this->from=T ( from_ );
                this->to = T ( to_ );
                this->cnt = Integer ( cnt_ );
                seed = chrono::system_clock::now().time_since_epoch().count();
            }
            inline void generateSingleRandom();
            inline void generatePairRandom();
        };
template<class T, class Integer>
        inline void MyRandom<T,Integer>::generateSingleRandom() {
        default_random_engine generator ( seed );
        if ( typeid ( T ).name() ==typeid ( float ).name() ||typeid ( T ).name() ==typeid ( double ).name() ) {
            uniform_real_distribution<double> distribution ( from,to );
            while ( cnt-- ) {
                T number = distribution ( generator );
                OUT<<number<<" ";
            }
        } else {
            uniform_int_distribution<T> distribution ( from,to );
            while ( cnt-- ) {
                T number = distribution ( generator );
                OUT<<number<<" ";
            }
        }


    }

template<class T, class Integer>
        inline void MyRandom<T,Integer>::generatePairRandom() {
        default_random_engine generator ( seed );
        if ( typeid ( T ).name() ==typeid ( float ).name() ||typeid ( T ).name() ==typeid ( double ).name() ) {
            uniform_real_distribution<double> distribution ( from,to );
            while ( cnt-- ) {
                T number1 = distribution ( generator );
                T number2 = distribution ( generator );
                if ( number1>number2 ) swap ( number1,number2 );
                OUT<< number1<<" "<<number2<<'\n';
            }
        } else {
            uniform_int_distribution<T> distribution ( from,to );
            while ( cnt-- ) {
                T number1 = distribution ( generator );
                T number2 = distribution ( generator );
                if ( number1>number2 ) swap ( number1,number2 );
                OUT<< number1<<" "<<number2<<'\n';
            }
        }


    }


// kate: indent-mode cstyle; indent-width 4; replace-tabs on; 



